<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改课程详情')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-coursePeriod-edit" th:object="${coursePeriod}">
            <input name="id" th:field="*{id}" type="hidden">
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">课程：</label>
                    <div class="col-sm-8">
                        <input name="infoId" th:field="*{name}" class="form-control" type="text" readonly="true" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">课程编码：</label>
                    <div class="col-sm-8">
                        <input name="infoId" th:field="*{code}" class="form-control" type="text" readonly="true" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">课程分类：</label>
                    <div class="col-sm-8">
                        <input name="infoId" th:field="*{type}" class="form-control" type="text" readonly="true" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">教师：</label>
                    <div class="col-sm-8">
                        <input name="infoId" th:field="*{teacherName}" class="form-control" type="text" readonly="true" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">课程节次：</label>
                    <div class="col-sm-8">
                        <input name="courseNum" th:field="*{courseNum}" class="form-control" type="text" readonly="true" >
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">课程日期：</label>
                    <div class="col-sm-8">
                        <div class="input-group date">
                            <input name="periodDate" th:value="${#dates.format(coursePeriod.periodDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                        </div>
                    </div>
                </div>
            </div>
<!--            <div class="col-xs-12">-->
<!--                <div class="form-group">-->
<!--                    <label class="col-sm-3 control-label">开始时间：</label>-->
<!--                    <div class="col-sm-8">-->
<!--                        <div class="input-group date">-->
<!--                            <input name="startTime" th:value="${#dates.format(coursePeriod.startTime, 'HH:mm:ss')}" class="form-control" placeholder="HH:mm:ss" type="text">-->
<!--                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
<!--            <div class="col-xs-12">-->
<!--                <div class="form-group">-->
<!--                    <label class="col-sm-3 control-label">结束时间：</label>-->
<!--                    <div class="col-sm-8">-->
<!--                        <div class="input-group date">-->
<!--                            <input name="endTime" th:value="${#dates.format(coursePeriod.endTime, 'HH:mm:ss')}" class="form-control" placeholder="HH:mm:ss" type="text">-->
<!--                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">是否划课：</label>
                    <div class="col-sm-8">
                        <select name="scratchOut" class="form-control m-b" th:with="type=${@dict.getType('scratch_out')}">
                            <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{scratchOut}"></option>
                        </select>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">课程说明：</label>
                    <div class="col-sm-8">
                        <textarea name="remark" class="form-control">[[*{remark}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "course/coursePeriod";
        $("#form-coursePeriod-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-coursePeriod-edit').serialize());
            }
        }

        $("input[name='periodDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='startTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='endTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>